import Home from "../layout/Home.vue";

/**
 * 管理员后台页面（控制台路由）
 * 1、管理员和用户是同一个控制台
 * role, // 角色控制
 * icon 菜单栏的小图标
 * title 标题
 */
export default {
    path: "/admin",
    name: "admin",
    redirect: "/dashboard",
    component: Home,
    children: [
        {
            path: "/dashboard",
            name: "dashboard",
            meta: {
                title: '系统首页',
                icon: "s-home"
            },
            component: () => import ( /* webpackChunkName: "base" */ "../views/Dashboard.vue")
        }, {
            path: "/doctor",
            name: "doctor",
            meta: {
                title: '医生管理',
                icon: "lx-profile",
                role: ['admin'], // 管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/doctor/Doctor.vue")
        }, {
            path: "/patient",
            name: "patient",
            meta: {
                title: '患者管理',
                icon: "lx-friend",
                role: ['doctor', 'admin'], // 医生可见 管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/patient/Patient.vue")
        },
        // {
        //     path: "/clinic",
        //     name: "clinic",
        //     meta: {
        //         title: '诊所管理',
        //         icon: "lx-punch",
        //         role: ['admin'], // 管理员可见
        //     },
        //     component: () => import ( /* webpackChunkName: "admin" */ "../views/clinic/Clinic.vue")
        // },
        {
            path: "/medicine",
            name: "medicine",
            meta: {
                title: '药品管理',
                icon: "lx-present",
                role: ['doctor', 'admin'], // 医生可见 管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/medicine/Medicine.vue")
        }, {
            path: "/news",
            name: "news",
            meta: {
                title: '用药说明',
                icon: "lx-news",
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/news/News.vue")
        }, {
            path: '/orders',
            name: 'orders',
            meta: {
                title: '订单管理',
                icon: "lx-edit",
                role: ['doctor', 'admin'], // 医生可见 管理员可见
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/orders/Orders.vue')
        },
        {
            path: '/message',
            name: 'message',
            meta: {
                title: '留言管理',
                icon: "lx-mail",
                role: ['patient', 'doctor'], // 患者、医生可见
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/message/Message.vue')
        },
        {
            path: '/user',
            name: 'user',
            meta: {
                title: '个人中心',
                icon: "lx-addressbook",
                role: ['patient'], // 患者可见
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/User.vue')
        },
        // {
        //     path: "/icon",
        //     name: "icon",
        //     meta: {
        //         icon: "lx-emojifill",
        //         title: '自定义图标'
        //     },
        //     component: () => import ( /* webpackChunkName: "icon" */ "../views/Icon.vue")
        // },

    ]
}
